home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C++ / Applications / SeeMovieRun 2.0 / Source / x_CQTDoc.cp < prev   
Encoding:
Text File  |  1995-08-02  |  4.1 KB  |  162 lines  |  [TEXT/KAHL]

  1. /******************************************************************************
  2.  x_CQTDoc.cp
  3.  
  4.                 CQTDoc Document Class
  5.     
  6.     Copyright Â© 1995 Gregory Bonk for NewMedia Inc.. All rights reserved.
  7.  
  8.     Generated by Visual Architectâ„¢ 12:55 PM Wed, Aug 2, 1995
  9.  
  10.     This file is rewritten each time you generate code. You should not
  11.     make changes to this file; changes should go in the My.cp
  12.     file, instead.
  13.  
  14.     If you want to change how Visual Architect generates this file, you can
  15.     change the template for this file. It is "_Doc_cp" in the Visual Architect
  16.     Templates folder.
  17.  
  18.  ******************************************************************************/
  19.  
  20. #include "x_CQTDoc.h"
  21.  
  22. #include "CQTDoc.h"
  23.  
  24. #include "CQTDocItems.h"
  25.  
  26. #include "ViewUtilities.h"
  27. #include "CQTApp.h"
  28.  
  29. #include <CApplication.h>
  30. #include <CBartender.h>
  31. #include <Commands.h>
  32. #include <Constants.h>
  33. #include <CDecorator.h>
  34. #include <CDesktop.h>
  35. #include <CFile.h>
  36. #include <TBUtilities.h>
  37. #include <CWindow.h>
  38.  
  39. extern    CApplication *gApplication;        /* The application                    */
  40. extern CDecorator    *gDecorator;        /* Decorator for arranging windows    */
  41. extern CDesktop        *gDesktop;            /* The visible Desktop                */
  42. extern CBartender    *gBartender;        /* Manages all menus                */
  43.  
  44.  
  45.     // Define symbols for commands handled by this class
  46.     // Prevents a recompile every time any command changed.
  47.  
  48. #define cmdImportMovieItem 512
  49.  
  50.  
  51. TCL_DEFINE_CLASS_M1(x_CQTDoc, x_CQTDoc_super);
  52.  
  53. /**** C O N S T R U C T I O N / D E S T R U C T I O N   M E T H O D S ****/
  54.  
  55.  
  56. /******************************************************************************
  57.  Ix_CQTDoc
  58.  
  59.     Initialize the document
  60.  ******************************************************************************/
  61.  
  62. void x_CQTDoc::Ix_CQTDoc()
  63.  
  64. {
  65.     IDocument(gApplication, TRUE);
  66.  
  67.         // Initialize data members below.
  68. }
  69.  
  70.  
  71. /******************************************************************************
  72.  MakeNewWindow
  73.  
  74.     Create a new, empty window.  Subclass may override to populate
  75.     the new window.
  76.  ******************************************************************************/
  77.  
  78. void x_CQTDoc::MakeNewWindow(void)
  79.  
  80. {
  81.     itsWindow = TCLGetNamedWindow("\pCQTDoc", this);
  82.     
  83.     itsMainPane = (CPane*) TCLGetItemPointer(itsWindow, 0);
  84.  
  85.         // Initialize pointers to the subpanes in the window
  86.  
  87. }
  88.  
  89.  
  90. /******************************************************************************
  91.  FailOpen {OVERRIDE}
  92.  
  93.         Fail if file already open in this application.
  94.         
  95.         This function calls the application's FileAlreadyOpen function
  96.         and fails quietly if the file is open.
  97.  
  98.         Note that open may also fail if the file is open in
  99.         another application. This will cause a failure in open,
  100.         but you may wish to override this function to detect this
  101.         case and provide a more meaningful error message than -49.
  102.  ******************************************************************************/
  103.  
  104. void    x_CQTDoc::FailOpen(FSSpec *spec)
  105. {
  106.                                         /* Only the application knows        */
  107.     if (((CQTApp*)gApplication)->FileAlreadyOpen(spec))
  108.         Failure(kSilentErr, 0);
  109. }
  110.  
  111.  
  112. /******************************************************************************
  113.  PositionWindow
  114.  
  115.     The default method in CSaver calls the the decorator, which
  116.     staggers and resizes the window. Since the window has already
  117.     been positioned when it is initialized from the view resource,
  118.     we don't want to do this twice.
  119.  ******************************************************************************/
  120.  
  121. void    x_CQTDoc::PositionWindow()
  122.  
  123. {
  124. }
  125.  
  126.  
  127.  
  128.  
  129. /******************************************************************************
  130.  DoCommand {OVERRIDE}
  131.  
  132.         Dispatch Visual Architect-specified actions.
  133.  ******************************************************************************/
  134.  
  135. void x_CQTDoc::DoCommand(long theCommand)
  136.  
  137. {
  138.     switch (theCommand)
  139.     {
  140.         case cmdImportMovieItem:
  141.             break;
  142.         default:
  143.             CDocument::DoCommand(theCommand);
  144.     }
  145. }
  146.  
  147.  
  148. /******************************************************************************
  149.  UpdateMenus {OVERRIDE}
  150.  
  151.         Enable menus which generate commands handled by this class.
  152.  ******************************************************************************/
  153.  
  154. void x_CQTDoc::UpdateMenus()
  155.  
  156. {
  157.     CDocument::UpdateMenus();
  158.     gBartender->EnableCmd(cmdImportMovieItem);
  159. }
  160.  
  161.  
  162.